//
//  Select_Simple_View.m
//  MindBox
//
//  Created by MS on 16-1-14.
//  Copyright (c) 2016年 Lemon. All rights reserved.
//
#define SLIP_VIEW_HEIGHT 1.5
#import "Select_Simple_View.h"
#import "UIView+Frame.h"
@implementation Select_Simple_View



- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        UIView * lin = [[UIView alloc] initWithFrame:CGRectMake(0, self.height-0.5, self.width, 0.5)];
        [self addSubview:lin];
        lin.backgroundColor = [UIColor lightGrayColor];
        
    }
    return self;
}



-(void)layoutSubviews
{
    [super layoutSubviews];
    
    int i = 0;
    NSInteger count =self.btnArray.count;
    CGFloat margin = (self.width - 30 * count)/count;
    
    for (UIButton * btn in self.btnArray) {

        btn.x = margin*0.3+(btn.width+margin)*i;

        if (i==1) {
            self.slipView.frame = CGRectMake(btn.x, self.height-SLIP_VIEW_HEIGHT, btn.width, SLIP_VIEW_HEIGHT);
        }
            i++;
    }
    
}



@end
